<template>
  <div>
    <!-- height: 500px; -->
    <el-container style="height: 800px; border: 1px solid #eee">
      <el-aside width="200px" style="background-color: rgb(238, 241, 246)">
        <el-menu
          :default-openeds="['1', '2','3']"
          router
          :default-active="this.$route.path"
        >
          <el-submenu index="1">
            <template slot="title"
              ><i class="el-icon-message"></i>用户管理</template
            >
            <el-menu-item-group>
              <el-menu-item index="/userManager/add"
                ><i class="el-icon-s-custom"></i>添加用户</el-menu-item
              >
              <el-menu-item index="/userManager/list"
                ><i class="el-icon-s-check"></i>用户列表</el-menu-item
              >
            </el-menu-item-group>
          </el-submenu>
          <el-submenu index="2">
            <template slot="title"
              ><i class="el-icon-s-order"></i>账单管理</template
            >
            <el-menu-item-group>
              <el-menu-item index="/orderManager/add"
                ><i class="el-icon-s-promotion"></i>添加账单</el-menu-item
              >
              <el-menu-item index="/orderManager/list"
                ><i class="el-icon-s-comment"></i>账单列表</el-menu-item
              >
            </el-menu-item-group>
          </el-submenu>
          <el-submenu index="3">
            <template slot="title"
              ><i class="el-icon-s-order"></i>文件测试</template
            >
            <el-menu-item-group>
              <el-menu-item index="/file/fileUpload"
                ><i class="el-icon-s-promotion"></i>上传文件</el-menu-item
              >
              <el-menu-item index="/file/fileDownload"
                ><i class="el-icon-s-comment"></i>下载文件</el-menu-item
              >
            </el-menu-item-group>
          </el-submenu>
        </el-menu>
      </el-aside>

      <el-container>
        <el-header style="font-size: 12px">
          <div class="el-header-left">
            <el-button type="primary" @click="$router.push('/userManager/add')"
              >添加用户</el-button
            >
            <el-button type="primary" @click="$router.push('/userManager/list')"
              >用户列表</el-button
            >
          </div>
          <el-button
            type="primary"
            style="height: 40px; margin-right: 0px"
            @click="logout"
            >退出登录</el-button
          >
        </el-header>

        <el-main>
          <router-view></router-view>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>
<script>
export default {
  name: "userManagerview",
  methods: {
    // 退出登录
    logout() {
      // 退出登录后，跳转到首页
      this.$router.push("/");
      //提示信息
      this.$message({
        message: "退出登录成功，期待您的下次光临",
        type: "success",
      });
    },
  },
};
</script>
<style lang="scss" scoped>
.el-header {
  background-color: #b3c0d1;
  color: #333;
  line-height: 60px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.el-aside {
  margin-top: 30px;
  color: #333;
  height: 1000px;
}
.el-container {
  height: 1000px;
}
</style>
